home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gcc / gcc258s.zoo / gcc.info-14 < prev    next >
Encoding:
GNU Info File  |  1993-11-30  |  32.1 KB  |  940 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Published by the Free Software Foundation 675 Massachusetts Avenue
  7. Cambridge, MA 02139 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  10.  
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.  
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License" and "Protect
  18. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  19. original, and provided that the entire resulting derived work is
  20. distributed under the terms of a permission notice identical to this
  21. one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the sections entitled "GNU General Public
  26. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  27. permission notice, may be included in translations approved by the Free
  28. Software Foundation instead of in the original English.
  29.  
  30. File: gcc.info,  Node: Output Statement,  Next: Constraints,  Prev: Output Template,  Up: Machine Desc
  31.  
  32. C Statements for Assembler Output
  33. =================================
  34.  
  35.    Often a single fixed template string cannot produce correct and
  36. efficient assembler code for all the cases that are recognized by a
  37. single instruction pattern.  For example, the opcodes may depend on the
  38. kinds of operands; or some unfortunate combinations of operands may
  39. require extra machine instructions.
  40.  
  41.    If the output control string starts with a `@', then it is actually
  42. a series of templates, each on a separate line.  (Blank lines and
  43. leading spaces and tabs are ignored.)  The templates correspond to the
  44. pattern's constraint alternatives (*note Multi-Alternative::.).  For
  45. example, if a target machine has a two-address add instruction `addr'
  46. to add into a register and another `addm' to add a register to memory,
  47. you might write this pattern:
  48.  
  49.      (define_insn "addsi3"
  50.        [(set (match_operand:SI 0 "general_operand" "=r,m")
  51.              (plus:SI (match_operand:SI 1 "general_operand" "0,0")
  52.                       (match_operand:SI 2 "general_operand" "g,r")))]
  53.        ""
  54.        "@
  55.         addr %2,%0
  56.         addm %2,%0")
  57.  
  58.    If the output control string starts with a `*', then it is not an
  59. output template but rather a piece of C program that should compute a
  60. template.  It should execute a `return' statement to return the
  61. template-string you want.  Most such templates use C string literals,
  62. which require doublequote characters to delimit them.  To include these
  63. doublequote characters in the string, prefix each one with `\'.
  64.  
  65.    The operands may be found in the array `operands', whose C data type
  66. is `rtx []'.
  67.  
  68.    It is very common to select different ways of generating assembler
  69. code based on whether an immediate operand is within a certain range.
  70. Be careful when doing this, because the result of `INTVAL' is an
  71. integer on the host machine.  If the host machine has more bits in an
  72. `int' than the target machine has in the mode in which the constant
  73. will be used, then some of the bits you get from `INTVAL' will be
  74. superfluous.  For proper results, you must carefully disregard the
  75. values of those bits.
  76.  
  77.    It is possible to output an assembler instruction and then go on to
  78. output or compute more of them, using the subroutine `output_asm_insn'.
  79. This receives two arguments: a template-string and a vector of
  80. operands.  The vector may be `operands', or it may be another array of
  81. `rtx' that you declare locally and initialize yourself.
  82.  
  83.    When an insn pattern has multiple alternatives in its constraints,
  84. often the appearance of the assembler code is determined mostly by
  85. which alternative was matched.  When this is so, the C code can test
  86. the variable `which_alternative', which is the ordinal number of the
  87. alternative that was actually satisfied (0 for the first, 1 for the
  88. second alternative, etc.).
  89.  
  90.    For example, suppose there are two opcodes for storing zero, `clrreg'
  91. for registers and `clrmem' for memory locations.  Here is how a pattern
  92. could use `which_alternative' to choose between them:
  93.  
  94.      (define_insn ""
  95.        [(set (match_operand:SI 0 "general_operand" "=r,m")
  96.              (const_int 0))]
  97.        ""
  98.        "*
  99.        return (which_alternative == 0
  100.                ? \"clrreg %0\" : \"clrmem %0\");
  101.        ")
  102.  
  103.    The example above, where the assembler code to generate was *solely*
  104. determined by the alternative, could also have been specified as
  105. follows, having the output control string start with a `@':
  106.  
  107.      (define_insn ""
  108.        [(set (match_operand:SI 0 "general_operand" "=r,m")
  109.              (const_int 0))]
  110.        ""
  111.        "@
  112.         clrreg %0
  113.         clrmem %0")
  114.  
  115. File: gcc.info,  Node: Constraints,  Next: Standard Names,  Prev: Output Statement,  Up: Machine Desc
  116.  
  117. Operand Constraints
  118. ===================
  119.  
  120.    Each `match_operand' in an instruction pattern can specify a
  121. constraint for the type of operands allowed.  Constraints can say
  122. whether an operand may be in a register, and which kinds of register;
  123. whether the operand can be a memory reference, and which kinds of
  124. address; whether the operand may be an immediate constant, and which
  125. possible values it may have.  Constraints can also require two operands
  126. to match.
  127.  
  128. * Menu:
  129.  
  130. * Simple Constraints::  Basic use of constraints.
  131. * Multi-Alternative::   When an insn has two alternative constraint-patterns.
  132. * Class Preferences::   Constraints guide which hard register to put things in.
  133. * Modifiers::           More precise control over effects of constraints.
  134. * Machine Constraints:: Existing constraints for some particular machines.
  135. * No Constraints::      Describing a clean machine without constraints.
  136.  
  137. File: gcc.info,  Node: Simple Constraints,  Next: Multi-Alternative,  Up: Constraints
  138.  
  139. Simple Constraints
  140. ------------------
  141.  
  142.    The simplest kind of constraint is a string full of letters, each of
  143. which describes one kind of operand that is permitted.  Here are the
  144. letters that are allowed:
  145.  
  146. `m'
  147.      A memory operand is allowed, with any kind of address that the
  148.      machine supports in general.
  149.  
  150. `o'
  151.      A memory operand is allowed, but only if the address is
  152.      "offsettable".  This means that adding a small integer (actually,
  153.      the width in bytes of the operand, as determined by its machine
  154.      mode) may be added to the address and the result is also a valid
  155.      memory address.
  156.  
  157.      For example, an address which is constant is offsettable; so is an
  158.      address that is the sum of a register and a constant (as long as a
  159.      slightly larger constant is also within the range of
  160.      address-offsets supported by the machine); but an autoincrement or
  161.      autodecrement address is not offsettable.  More complicated
  162.      indirect/indexed addresses may or may not be offsettable depending
  163.      on the other addressing modes that the machine supports.
  164.  
  165.      Note that in an output operand which can be matched by another
  166.      operand, the constraint letter `o' is valid only when accompanied
  167.      by both `<' (if the target machine has predecrement addressing)
  168.      and `>' (if the target machine has preincrement addressing).
  169.  
  170. `V'
  171.      A memory operand that is not offsettable.  In other words,
  172.      anything that would fit the `m' constraint but not the `o'
  173.      constraint.
  174.  
  175. `<'
  176.      A memory operand with autodecrement addressing (either
  177.      predecrement or postdecrement) is allowed.
  178.  
  179. `>'
  180.      A memory operand with autoincrement addressing (either
  181.      preincrement or postincrement) is allowed.
  182.  
  183. `r'
  184.      A register operand is allowed provided that it is in a general
  185.      register.
  186.  
  187. `d', `a', `f', ...
  188.      Other letters can be defined in machine-dependent fashion to stand
  189.      for particular classes of registers.  `d', `a' and `f' are defined
  190.      on the 68000/68020 to stand for data, address and floating point
  191.      registers.
  192.  
  193. `i'
  194.      An immediate integer operand (one with constant value) is allowed.
  195.      This includes symbolic constants whose values will be known only at
  196.      assembly time.
  197.  
  198. `n'
  199.      An immediate integer operand with a known numeric value is allowed.
  200.      Many systems cannot support assembly-time constants for operands
  201.      less than a word wide.  Constraints for these operands should use
  202.      `n' rather than `i'.
  203.  
  204. `I', `J', `K', ... `P'
  205.      Other letters in the range `I' through `P' may be defined in a
  206.      machine-dependent fashion to permit immediate integer operands with
  207.      explicit integer values in specified ranges.  For example, on the
  208.      68000, `I' is defined to stand for the range of values 1 to 8.
  209.      This is the range permitted as a shift count in the shift
  210.      instructions.
  211.  
  212. `E'
  213.      An immediate floating operand (expression code `const_double') is
  214.      allowed, but only if the target floating point format is the same
  215.      as that of the host machine (on which the compiler is running).
  216.  
  217. `F'
  218.      An immediate floating operand (expression code `const_double') is
  219.      allowed.
  220.  
  221. `G', `H'
  222.      `G' and `H' may be defined in a machine-dependent fashion to
  223.      permit immediate floating operands in particular ranges of values.
  224.  
  225. `s'
  226.      An immediate integer operand whose value is not an explicit
  227.      integer is allowed.
  228.  
  229.      This might appear strange; if an insn allows a constant operand
  230.      with a value not known at compile time, it certainly must allow
  231.      any known value.  So why use `s' instead of `i'?  Sometimes it
  232.      allows better code to be generated.
  233.  
  234.      For example, on the 68000 in a fullword instruction it is possible
  235.      to use an immediate operand; but if the immediate value is between
  236.      -128 and 127, better code results from loading the value into a
  237.      register and using the register.  This is because the load into
  238.      the register can be done with a `moveq' instruction.  We arrange
  239.      for this to happen by defining the letter `K' to mean "any integer
  240.      outside the range -128 to 127", and then specifying `Ks' in the
  241.      operand constraints.
  242.  
  243. `g'
  244.      Any register, memory or immediate integer operand is allowed,
  245.      except for registers that are not general registers.
  246.  
  247. `X'
  248.      Any operand whatsoever is allowed, even if it does not satisfy
  249.      `general_operand'.  This is normally used in the constraint of a
  250.      `match_scratch' when certain alternatives will not actually
  251.      require a scratch register.
  252.  
  253. `0', `1', `2', ... `9'
  254.      An operand that matches the specified operand number is allowed.
  255.      If a digit is used together with letters within the same
  256.      alternative, the digit should come last.
  257.  
  258.      This is called a "matching constraint" and what it really means is
  259.      that the assembler has only a single operand that fills two roles
  260.      considered separate in the RTL insn.  For example, an add insn has
  261.      two input operands and one output operand in the RTL, but on most
  262.      CISC machines an add instruction really has only two operands, one
  263.      of them an input-output operand:
  264.  
  265.           addl #35,r12
  266.  
  267.      Matching constraints are used in these circumstances.  More
  268.      precisely, the two operands that match must include one input-only
  269.      operand and one output-only operand.  Moreover, the digit must be a
  270.      smaller number than the number of the operand that uses it in the
  271.      constraint.
  272.  
  273.      For operands to match in a particular case usually means that they
  274.      are identical-looking RTL expressions.  But in a few special cases
  275.      specific kinds of dissimilarity are allowed.  For example, `*x' as
  276.      an input operand will match `*x++' as an output operand.  For
  277.      proper results in such cases, the output template should always
  278.      use the output-operand's number when printing the operand.
  279.  
  280. `p'
  281.      An operand that is a valid memory address is allowed.  This is for
  282.      "load address" and "push address" instructions.
  283.  
  284.      `p' in the constraint must be accompanied by `address_operand' as
  285.      the predicate in the `match_operand'.  This predicate interprets
  286.      the mode specified in the `match_operand' as the mode of the memory
  287.      reference for which the address would be valid.
  288.  
  289. `Q', `R', `S', ... `U'
  290.      Letters in the range `Q' through `U' may be defined in a
  291.      machine-dependent fashion to stand for arbitrary operand types.
  292.      The machine description macro `EXTRA_CONSTRAINT' is passed the
  293.      operand as its first argument and the constraint letter as its
  294.      second operand.
  295.  
  296.      A typical use for this would be to distinguish certain types of
  297.      memory references that affect other insn operands.
  298.  
  299.      Do not define these constraint letters to accept register
  300.      references (`reg'); the reload pass does not expect this and would
  301.      not handle it properly.
  302.  
  303.    In order to have valid assembler code, each operand must satisfy its
  304. constraint.  But a failure to do so does not prevent the pattern from
  305. applying to an insn.  Instead, it directs the compiler to modify the
  306. code so that the constraint will be satisfied.  Usually this is done by
  307. copying an operand into a register.
  308.  
  309.    Contrast, therefore, the two instruction patterns that follow:
  310.  
  311.      (define_insn ""
  312.        [(set (match_operand:SI 0 "general_operand" "=r")
  313.              (plus:SI (match_dup 0)
  314.                       (match_operand:SI 1 "general_operand" "r")))]
  315.        ""
  316.        "...")
  317.  
  318. which has two operands, one of which must appear in two places, and
  319.  
  320.      (define_insn ""
  321.        [(set (match_operand:SI 0 "general_operand" "=r")
  322.              (plus:SI (match_operand:SI 1 "general_operand" "0")
  323.                       (match_operand:SI 2 "general_operand" "r")))]
  324.        ""
  325.        "...")
  326.  
  327. which has three operands, two of which are required by a constraint to
  328. be identical.  If we are considering an insn of the form
  329.  
  330.      (insn N PREV NEXT
  331.        (set (reg:SI 3)
  332.             (plus:SI (reg:SI 6) (reg:SI 109)))
  333.        ...)
  334.  
  335. the first pattern would not apply at all, because this insn does not
  336. contain two identical subexpressions in the right place.  The pattern
  337. would say, "That does not look like an add instruction; try other
  338. patterns." The second pattern would say, "Yes, that's an add
  339. instruction, but there is something wrong with it."  It would direct
  340. the reload pass of the compiler to generate additional insns to make
  341. the constraint true.  The results might look like this:
  342.  
  343.      (insn N2 PREV N
  344.        (set (reg:SI 3) (reg:SI 6))
  345.        ...)
  346.      
  347.      (insn N N2 NEXT
  348.        (set (reg:SI 3)
  349.             (plus:SI (reg:SI 3) (reg:SI 109)))
  350.        ...)
  351.  
  352.    It is up to you to make sure that each operand, in each pattern, has
  353. constraints that can handle any RTL expression that could be present for
  354. that operand.  (When multiple alternatives are in use, each pattern
  355. must, for each possible combination of operand expressions, have at
  356. least one alternative which can handle that combination of operands.)
  357. The constraints don't need to *allow* any possible operand--when this is
  358. the case, they do not constrain--but they must at least point the way to
  359. reloading any possible operand so that it will fit.
  360.  
  361.    * If the constraint accepts whatever operands the predicate permits,
  362.      there is no problem: reloading is never necessary for this operand.
  363.  
  364.      For example, an operand whose constraints permit everything except
  365.      registers is safe provided its predicate rejects registers.
  366.  
  367.      An operand whose predicate accepts only constant values is safe
  368.      provided its constraints include the letter `i'.  If any possible
  369.      constant value is accepted, then nothing less than `i' will do; if
  370.      the predicate is more selective, then the constraints may also be
  371.      more selective.
  372.  
  373.    * Any operand expression can be reloaded by copying it into a
  374.      register.  So if an operand's constraints allow some kind of
  375.      register, it is certain to be safe.  It need not permit all
  376.      classes of registers; the compiler knows how to copy a register
  377.      into another register of the proper class in order to make an
  378.      instruction valid.
  379.  
  380.    * A nonoffsettable memory reference can be reloaded by copying the
  381.      address into a register.  So if the constraint uses the letter
  382.      `o', all memory references are taken care of.
  383.  
  384.    * A constant operand can be reloaded by allocating space in memory to
  385.      hold it as preinitialized data.  Then the memory reference can be
  386.      used in place of the constant.  So if the constraint uses the
  387.      letters `o' or `m', constant operands are not a problem.
  388.  
  389.    * If the constraint permits a constant and a pseudo register used in
  390.      an insn was not allocated to a hard register and is equivalent to
  391.      a constant, the register will be replaced with the constant.  If
  392.      the predicate does not permit a constant and the insn is
  393.      re-recognized for some reason, the compiler will crash.  Thus the
  394.      predicate must always recognize any objects allowed by the
  395.      constraint.
  396.  
  397.    If the operand's predicate can recognize registers, but the
  398. constraint does not permit them, it can make the compiler crash.  When
  399. this operand happens to be a register, the reload pass will be stymied,
  400. because it does not know how to copy a register temporarily into memory.
  401.  
  402. File: gcc.info,  Node: Multi-Alternative,  Next: Class Preferences,  Prev: Simple Constraints,  Up: Constraints
  403.  
  404. Multiple Alternative Constraints
  405. --------------------------------
  406.  
  407.    Sometimes a single instruction has multiple alternative sets of
  408. possible operands.  For example, on the 68000, a logical-or instruction
  409. can combine register or an immediate value into memory, or it can
  410. combine any kind of operand into a register; but it cannot combine one
  411. memory location into another.
  412.  
  413.    These constraints are represented as multiple alternatives.  An
  414. alternative can be described by a series of letters for each operand.
  415. The overall constraint for an operand is made from the letters for this
  416. operand from the first alternative, a comma, the letters for this
  417. operand from the second alternative, a comma, and so on until the last
  418. alternative.  Here is how it is done for fullword logical-or on the
  419. 68000:
  420.  
  421.      (define_insn "iorsi3"
  422.        [(set (match_operand:SI 0 "general_operand" "=m,d")
  423.              (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
  424.                      (match_operand:SI 2 "general_operand" "dKs,dmKs")))]
  425.        ...)
  426.  
  427.    The first alternative has `m' (memory) for operand 0, `0' for
  428. operand 1 (meaning it must match operand 0), and `dKs' for operand 2.
  429. The second alternative has `d' (data register) for operand 0, `0' for
  430. operand 1, and `dmKs' for operand 2.  The `=' and `%' in the
  431. constraints apply to all the alternatives; their meaning is explained
  432. in the next section (*note Class Preferences::.).
  433.  
  434.    If all the operands fit any one alternative, the instruction is
  435. valid.  Otherwise, for each alternative, the compiler counts how many
  436. instructions must be added to copy the operands so that that
  437. alternative applies.  The alternative requiring the least copying is
  438. chosen.  If two alternatives need the same amount of copying, the one
  439. that comes first is chosen.  These choices can be altered with the `?'
  440. and `!' characters:
  441.  
  442. `?'
  443.      Disparage slightly the alternative that the `?' appears in, as a
  444.      choice when no alternative applies exactly.  The compiler regards
  445.      this alternative as one unit more costly for each `?' that appears
  446.      in it.
  447.  
  448. `!'
  449.      Disparage severely the alternative that the `!' appears in.  This
  450.      alternative can still be used if it fits without reloading, but if
  451.      reloading is needed, some other alternative will be used.
  452.  
  453.    When an insn pattern has multiple alternatives in its constraints,
  454. often the appearance of the assembler code is determined mostly by which
  455. alternative was matched.  When this is so, the C code for writing the
  456. assembler code can use the variable `which_alternative', which is the
  457. ordinal number of the alternative that was actually satisfied (0 for
  458. the first, 1 for the second alternative, etc.).  *Note Output
  459. Statement::.
  460.  
  461. File: gcc.info,  Node: Class Preferences,  Next: Modifiers,  Prev: Multi-Alternative,  Up: Constraints
  462.  
  463. Register Class Preferences
  464. --------------------------
  465.  
  466.    The operand constraints have another function: they enable the
  467. compiler to decide which kind of hardware register a pseudo register is
  468. best allocated to.  The compiler examines the constraints that apply to
  469. the insns that use the pseudo register, looking for the
  470. machine-dependent letters such as `d' and `a' that specify classes of
  471. registers.  The pseudo register is put in whichever class gets the most
  472. "votes".  The constraint letters `g' and `r' also vote: they vote in
  473. favor of a general register.  The machine description says which
  474. registers are considered general.
  475.  
  476.    Of course, on some machines all registers are equivalent, and no
  477. register classes are defined.  Then none of this complexity is relevant.
  478.  
  479. File: gcc.info,  Node: Modifiers,  Next: Machine Constraints,  Prev: Class Preferences,  Up: Constraints
  480.  
  481. Constraint Modifier Characters
  482. ------------------------------
  483.  
  484. `='
  485.      Means that this operand is write-only for this instruction: the
  486.      previous value is discarded and replaced by output data.
  487.  
  488. `+'
  489.      Means that this operand is both read and written by the
  490.      instruction.
  491.  
  492.      When the compiler fixes up the operands to satisfy the constraints,
  493.      it needs to know which operands are inputs to the instruction and
  494.      which are outputs from it.  `=' identifies an output; `+'
  495.      identifies an operand that is both input and output; all other
  496.      operands are assumed to be input only.
  497.  
  498. `&'
  499.      Means (in a particular alternative) that this operand is written
  500.      before the instruction is finished using the input operands.
  501.      Therefore, this operand may not lie in a register that is used as
  502.      an input operand or as part of any memory address.
  503.  
  504.      `&' applies only to the alternative in which it is written.  In
  505.      constraints with multiple alternatives, sometimes one alternative
  506.      requires `&' while others do not.  See, for example, the `movdf'
  507.      insn of the 68000.
  508.  
  509.      `&' does not obviate the need to write `='.
  510.  
  511. `%'
  512.      Declares the instruction to be commutative for this operand and the
  513.      following operand.  This means that the compiler may interchange
  514.      the two operands if that is the cheapest way to make all operands
  515.      fit the constraints.  This is often used in patterns for addition
  516.      instructions that really have only two operands: the result must
  517.      go in one of the arguments.  Here for example, is how the 68000
  518.      halfword-add instruction is defined:
  519.  
  520.           (define_insn "addhi3"
  521.             [(set (match_operand:HI 0 "general_operand" "=m,r")
  522.                (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
  523.                         (match_operand:HI 2 "general_operand" "di,g")))]
  524.             ...)
  525.  
  526. `#'
  527.      Says that all following characters, up to the next comma, are to be
  528.      ignored as a constraint.  They are significant only for choosing
  529.      register preferences.
  530.  
  531. `*'
  532.      Says that the following character should be ignored when choosing
  533.      register preferences.  `*' has no effect on the meaning of the
  534.      constraint as a constraint, and no effect on reloading.
  535.  
  536.      Here is an example: the 68000 has an instruction to sign-extend a
  537.      halfword in a data register, and can also sign-extend a value by
  538.      copying it into an address register.  While either kind of
  539.      register is acceptable, the constraints on an address-register
  540.      destination are less strict, so it is best if register allocation
  541.      makes an address register its goal.  Therefore, `*' is used so
  542.      that the `d' constraint letter (for data register) is ignored when
  543.      computing register preferences.
  544.  
  545.           (define_insn "extendhisi2"
  546.             [(set (match_operand:SI 0 "general_operand" "=*d,a")
  547.                   (sign_extend:SI
  548.                    (match_operand:HI 1 "general_operand" "0,g")))]
  549.             ...)
  550.  
  551. File: gcc.info,  Node: Machine Constraints,  Next: No Constraints,  Prev: Modifiers,  Up: Constraints
  552.  
  553. Constraints for Particular Machines
  554. -----------------------------------
  555.  
  556.    Whenever possible, you should use the general-purpose constraint
  557. letters in `asm' arguments, since they will convey meaning more readily
  558. to people reading your code.  Failing that, use the constraint letters
  559. that usually have very similar meanings across architectures.  The most
  560. commonly used constraints are `m' and `r' (for memory and
  561. general-purpose registers respectively; *note Simple Constraints::.),
  562. and `I', usually the letter indicating the most common
  563. immediate-constant format.
  564.  
  565.    For each machine architecture, the `config/MACHINE.h' file defines
  566. additional constraints.  These constraints are used by the compiler
  567. itself for instruction generation, as well as for `asm' statements;
  568. therefore, some of the constraints are not particularly interesting for
  569. `asm'.  The constraints are defined through these macros:
  570.  
  571. `REG_CLASS_FROM_LETTER'
  572.      Register class constraints (usually lower case).
  573.  
  574. `CONST_OK_FOR_LETTER_P'
  575.      Immediate constant constraints, for non-floating point constants of
  576.      word size or smaller precision (usually upper case).
  577.  
  578. `CONST_DOUBLE_OK_FOR_LETTER_P'
  579.      Immediate constant constraints, for all floating point constants
  580.      and for constants of greater than word size precision (usually
  581.      upper case).
  582.  
  583. `EXTRA_CONSTRAINT'
  584.      Special cases of registers or memory.  This macro is not required,
  585.      and is only defined for some machines.
  586.  
  587.    Inspecting these macro definitions in the compiler source for your
  588. machine is the best way to be certain you have the right constraints.
  589. However, here is a summary of the machine-dependent constraints
  590. available on some particular machines.
  591.  
  592. *AMD 29000 family--`a29k.h'*
  593.     `l'
  594.           Local register 0
  595.  
  596.     `b'
  597.           Byte Pointer (`BP') register
  598.  
  599.     `q'
  600.           `Q' register
  601.  
  602.     `h'
  603.           Special purpose register
  604.  
  605.     `A'
  606.           First accumulator register
  607.  
  608.     `a'
  609.           Other accumulator register
  610.  
  611.     `f'
  612.           Floating point register
  613.  
  614.     `I'
  615.           Constant greater than 0, less than 0x100
  616.  
  617.     `J'
  618.           Constant greater than 0, less than 0x10000
  619.  
  620.     `K'
  621.           Constant whose high 24 bits are on (1)
  622.  
  623.     `L'
  624.           16 bit constant whose high 8 bits are on (1)
  625.  
  626.     `M'
  627.           32 bit constant whose high 16 bits are on (1)
  628.  
  629.     `N'
  630.           32 bit negative constant that fits in 8 bits
  631.  
  632.     `O'
  633.           The constant 0x80000000 or, on the 29050, any 32 bit constant
  634.           whose low 16 bits are 0.
  635.  
  636.     `P'
  637.           16 bit negative constant that fits in 8 bits
  638.  
  639.     `G'
  640.     `H'
  641.           A floating point constant (in `asm' statements, use the
  642.           machine independent `E' or `F' instead)
  643.  
  644. *IBM RS6000--`rs6000.h'*
  645.     `b'
  646.           Address base register
  647.  
  648.     `f'
  649.           Floating point register
  650.  
  651.     `h'
  652.           `MQ', `CTR', or `LINK' register
  653.  
  654.     `q'
  655.           `MQ' register
  656.  
  657.     `c'
  658.           `CTR' register
  659.  
  660.     `l'
  661.           `LINK' register
  662.  
  663.     `x'
  664.           `CR' register (condition register) number 0
  665.  
  666.     `y'
  667.           `CR' register (condition register)
  668.  
  669.     `I'
  670.           Signed 16 bit constant
  671.  
  672.     `J'
  673.           Constant whose low 16 bits are 0
  674.  
  675.     `K'
  676.           Constant whose high 16 bits are 0
  677.  
  678.     `L'
  679.           Constant suitable as a mask operand
  680.  
  681.     `M'
  682.           Constant larger than 31
  683.  
  684.     `N'
  685.           Exact power of 2
  686.  
  687.     `O'
  688.           Zero
  689.  
  690.     `P'
  691.           Constant whose negation is a signed 16 bit constant
  692.  
  693.     `G'
  694.           Floating point constant that can be loaded into a register
  695.           with one instruction per word
  696.  
  697.     `Q'
  698.           Memory operand that is an offset from a register (`m' is
  699.           preferable for `asm' statements)
  700.  
  701. *Intel 386--`i386.h'*
  702.     `q'
  703.           `a', `b', `c', or `d' register
  704.  
  705.     `f'
  706.           Floating point register
  707.  
  708.     `t'
  709.           First (top of stack) floating point register
  710.  
  711.     `u'
  712.           Second floating point register
  713.  
  714.     `a'
  715.           `a' register
  716.  
  717.     `b'
  718.           `b' register
  719.  
  720.     `c'
  721.           `c' register
  722.  
  723.     `d'
  724.           `d' register
  725.  
  726.     `D'
  727.           `di' register
  728.  
  729.     `S'
  730.           `si' register
  731.  
  732.     `I'
  733.           Constant in range 0 to 31 (for 32 bit shifts)
  734.  
  735.     `J'
  736.           Constant in range 0 to 63 (for 64 bit shifts)
  737.  
  738.     `K'
  739.           `0xff'
  740.  
  741.     `L'
  742.           `0xffff'
  743.  
  744.     `M'
  745.           0, 1, 2, or 3 (shifts for `lea' instruction)
  746.  
  747.     `G'
  748.           Standard 80387 floating point constant
  749.  
  750. *Intel 960--`i960.h'*
  751.     `f'
  752.           Floating point register (`fp0' to `fp3')
  753.  
  754.     `l'
  755.           Local register (`r0' to `r15')
  756.  
  757.     `b'
  758.           Global register (`g0' to `g15')
  759.  
  760.     `d'
  761.           Any local or global register
  762.  
  763.     `I'
  764.           Integers from 0 to 31
  765.  
  766.     `J'
  767.           0
  768.  
  769.     `K'
  770.           Integers from -31 to 0
  771.  
  772.     `G'
  773.           Floating point 0
  774.  
  775.     `H'
  776.           Floating point 1
  777.  
  778. *MIPS--`mips.h'*
  779.     `d'
  780.           General-purpose integer register
  781.  
  782.     `f'
  783.           Floating-point register (if available)
  784.  
  785.     `h'
  786.           `Hi' register
  787.  
  788.     `l'
  789.           `Lo' register
  790.  
  791.     `x'
  792.           `Hi' or `Lo' register
  793.  
  794.     `y'
  795.           General-purpose integer register
  796.  
  797.     `z'
  798.           Floating-point status register
  799.  
  800.     `I'
  801.           Signed 16 bit constant (for arithmetic instructions)
  802.  
  803.     `J'
  804.           Zero
  805.  
  806.     `K'
  807.           Zero-extended 16-bit constant (for logic instructions)
  808.  
  809.     `L'
  810.           Constant with low 16 bits zero (can be loaded with `lui')
  811.  
  812.     `M'
  813.           32 bit constant which requires two instructions to load (a
  814.           constant which is not `I', `K', or `L')
  815.  
  816.     `N'
  817.           Negative 16 bit constant
  818.  
  819.     `O'
  820.           Exact power of two
  821.  
  822.     `P'
  823.           Positive 16 bit constant
  824.  
  825.     `G'
  826.           Floating point zero
  827.  
  828.     `Q'
  829.           Memory reference that can be loaded with more than one
  830.           instruction (`m' is preferable for `asm' statements)
  831.  
  832.     `R'
  833.           Memory reference that can be loaded with one instruction (`m'
  834.           is preferable for `asm' statements)
  835.  
  836.     `S'
  837.           Memory reference in external OSF/rose PIC format (`m' is
  838.           preferable for `asm' statements)
  839.  
  840. *Motorola 680x0--`m68k.h'*
  841.     `a'
  842.           Address register
  843.  
  844.     `d'
  845.           Data register
  846.  
  847.     `f'
  848.           68881 floating-point register, if available
  849.  
  850.     `x'
  851.           Sun FPA (floating-point) register, if available
  852.  
  853.     `y'
  854.           First 16 Sun FPA registers, if available
  855.  
  856.     `I'
  857.           Integer in the range 1 to 8
  858.  
  859.     `J'
  860.           16 bit signed number
  861.  
  862.     `K'
  863.           Signed number whose magnitude is greater than 0x80
  864.  
  865.     `L'
  866.           Integer in the range -8 to -1
  867.  
  868.     `G'
  869.           Floating point constant that is not a 68881 constant
  870.  
  871.     `H'
  872.           Floating point constant that can be used by Sun FPA
  873.  
  874. *SPARC--`sparc.h'*
  875.     `f'
  876.           Floating-point register
  877.  
  878.     `I'
  879.           Signed 13 bit constant
  880.  
  881.     `J'
  882.           Zero
  883.  
  884.     `K'
  885.           32 bit constant with the low 12 bits clear (a constant that
  886.           can be loaded with the `sethi' instruction)
  887.  
  888.     `G'
  889.           Floating-point zero
  890.  
  891.     `H'
  892.           Signed 13 bit constant, sign-extended to 32 or 64 bits
  893.  
  894.     `Q'
  895.           Memory reference that can be loaded with one instruction
  896.           (`m' is more appropriate for `asm' statements)
  897.  
  898.     `S'
  899.           Constant, or memory address
  900.  
  901.     `T'
  902.           Memory address aligned to an 8-byte boundary
  903.  
  904.     `U'
  905.           Even register
  906.  
  907. File: gcc.info,  Node: No Constraints,  Prev: Machine Constraints,  Up: Constraints
  908.  
  909. Not Using Constraints
  910. ---------------------
  911.  
  912.    Some machines are so clean that operand constraints are not
  913. required.  For example, on the Vax, an operand valid in one context is
  914. valid in any other context.  On such a machine, every operand
  915. constraint would be `g', excepting only operands of "load address"
  916. instructions which are written as if they referred to a memory
  917. location's contents but actual refer to its address.  They would have
  918. constraint `p'.
  919.  
  920.    For such machines, instead of writing `g' and `p' for all the
  921. constraints, you can choose to write a description with empty
  922. constraints.  Then you write `""' for the constraint in every
  923. `match_operand'.  Address operands are identified by writing an
  924. `address' expression around the `match_operand', not by their
  925. constraints.
  926.  
  927.    When the machine description has just empty constraints, certain
  928. parts of compilation are skipped, making the compiler faster.  However,
  929. few machines actually do not need constraints; all machine descriptions
  930. now in existence use constraints.
  931.  
  932.